package net.zjitc.stack;

public class Demo {
    public static void main(String[] args) {
       //int sum =  add(2,3);
        int sum = f(10);
        System.out.println(sum);
    }

    private static int add(int a, int b) {
        return a+b;
    }

    // 1....   10 不要用循环

    public static int f(int x ){
        if (x == 1)
            return 1;
        return x + f(x-1);
    }
}
